package com.ows.powercontrol.controller;

import com.ows.powercontrol.pojo.Status;
import com.ows.powercontrol.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

/**
 * @author cq
 * @date 2020/6/22 19:54
 */
@RestController
@RequestMapping("/common")
public class CommonController {

    @Autowired
    private CommonService commonService;

    @GetMapping
    public Status getStatus() {
        return commonService.getStatus();
    }

    @PostMapping("/up")
    public void up() {
        commonService.up();
    }

    @PostMapping("/quicken")
    public void quicken() {
        commonService.quicken();
    }

    @PostMapping("/slow")
    public void slow() {
        commonService.slow();
    }

    @PostMapping("/stop")
    public void stop() {
        commonService.stop();
    }

    @PostMapping("/revers")
    public void revers() {
       commonService.revers();
    }
}
